package com.base.cn.platform.os.service.manage.area;

import com.base.cn.platform.os.entity.manage.area.SysArea;
import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient(value = BaseService.appName,configuration = FeignAuthConfig.class)
public interface SysAreaService extends BaseService {


    /**
     * 根据Ids 搜索地址
     * @param areaIds
     * @return List<SysArea>
     */
    @RequestMapping(contextPath + "/querySysAreaListByIds")
    List<SysArea> querySysAreaListByIds(@RequestParam("areaIds") String areaIds);


    /**
     * 根据Ids 搜索地址
     * @param areaIds
     * @return Map<BigDecimal,SysArea>
     */
    @RequestMapping(contextPath + "/querySysAreaMapByIds")
    Map<BigDecimal,SysArea> querySysAreaMapByIds(@RequestParam("areaIds") String areaIds);


    /**
     * 搜索地址
     * @param sysArea
     * @return Map<BigDecimal,SysArea>
     */
    @RequestMapping(contextPath + "/queryUserAreaList")
    List<SysArea> queryUserAreaList(@RequestBody SysArea sysArea);


    /**
     * 根据Ids 搜索地址
     * @param parentId
     * @return Map<BigDecimal,Map<String,Object>>
     */
    @RequestMapping(contextPath + "/querySysAreaMapByParentId")
    Map<BigDecimal,SysArea> querySysAreaMapByParentId(@RequestParam("parentId") BigDecimal parentId);

    /**
     * 通过父级id串，查询地区列表
     * @param parentIds 父级id串
     * @return
     */
    @RequestMapping(contextPath + "/querySysAreaMapByParentIds")
    Map<BigDecimal,List<SysArea>> querySysAreaMapByParentIds(@RequestParam("parentIds") String parentIds);

    /**
     *查询说有地区
     * @return
     */
    @RequestMapping(contextPath+"/queryFullAddress")
    SysArea queryFullAddress(@RequestParam("areaType") Integer areaType,@RequestParam("name") String name);
}
